using System;
using System.Collections.Generic;
using System.Text;

namespace S2Engine.Spriting
{
    class XpriteManager
    {
        private Xprite[] sprites;
        private Xprite currentSprite;
        private int currentSpriteIndex;

        public XpriteManager(Game game,Xprite[] sprites)
        {

        }

        private Xprite CurrentSprite
        {
            get { return currentSprite; }
        }

        public int CurrentSpriteIndex
        {
            get { return currentSpriteIndex; }
        }

        public void Play()
        {
            if (currentSprite != null)
                currentSprite.Play();
        }

        public void Play(int spriteIndex)
        {
            currentSpriteIndex = spriteIndex;
            currentSprite = sprites[spriteIndex];
        }

        public void Pause()
        {
            if (currentSprite != null)
                currentSprite.Pause();
        }

        public void Update()
        {
            if(currentSprite != null)
                currentSprite.Update();
        }

        public void Draw()
        {
            if(currentSprite != null)
                currentSprite.Draw();
        }
    }
}
